<template>
	<view class="container">
		<u-toast ref="uToast" />
		<u-navbar :is-back="true" title="待审批" back-icon-color='#333333' height="50" :border-bottom="false">
		</u-navbar>
		<u-mask :show="display">
			<view class="warp">
				<view class="rect" @tap.stop>
					<view class="tanchu">
						确认取消申请?
					</view>
					<view class="anniu">
						<view class="" @click="display=false">
							取消
						</view>
						<view class="" @click.stop="delete_meeting">
							确定
						</view>
					</view>
				</view>
			</view>
		</u-mask>
		<view class="list">
			<view class="name">
				<text>名称:</text>
				<text>{{meeting_list.meeting_room_detail?meeting_list.meeting_room_detail.name:''}}</text>
			</view>
			<view class="num">
				<text>ID:</text>
				<text>{{meeting_list.meeting_room_detail?meeting_list.meeting_room_detail.meeting_room_id:''}}</text>
			</view>
			<view class="address">
				<text>地点</text>
				<text>{{meeting_list.meeting_room_detail?meeting_list.meeting_room_detail.place:''}}</text>
			</view>
			<view class="type">
				<text>类型</text>
				<text>{{meeting_list.meeting_room_detail?meeting_list.meeting_room_detail.type:''}}</text>
			</view>
			<view class="galleryful">
				<text>容纳人数</text>
				<text>{{meeting_list.meeting_room_detail?meeting_list.meeting_room_detail.people:''}}</text>
			</view>
			<view class="remarks">
				<text>备注</text>
				<text>{{meeting_list.meeting_room_detail?meeting_list.meeting_room_detail.remark:''}}</text>
			</view>
			<view class="time">
				<text>使用时间</text>
				<text>{{meeting_list.start_time}}</text>
			<!-- 	<text>12:00:00</text> -->
				<text>-</text>
			<text>{{meeting_list.end_time}}</text>
			</view>
			<view class="event">
				<text>事件</text>
				<input type="text" value="" v-model="content" placeholder="单行输入" />
			</view>
			<view class="" style="width:100rpx; height:35rpx;">

			</view>
		</view>
		<view class="confirm">
			<view class="cancel" @click="display=true">
				{{cancel}}
			</view>
			<view class="verify" @click.stop="submit">
				{{verify}}
			</view>

		</view>
	</view>
</template>

<script>
	import request from '../../request.js'
	export default {
		data() {
			return {
				content: '',
				verify: '修改申请',
				cancel: '取消申请',
				meeting_id: '',
				display: false,
				meeting_list: {}
			}
		},
		onLoad(option) {
			if (option.id) {
				this.meeting_id = option.id;
			}
			this.applyDetail();
		},
		methods: {
			applyDetail() {
				let _this = this;
				let base_url = uni.getStorageSync('host');
				request({
					url: base_url + 'teacher/meeting_room/applyDetail',
					method: 'post',
					data: {
						apply_id: this.meeting_id ? this.meeting_id : 14,
					},
					success(res) {
						if (res.statusCode == 200) {
							console.log(res.data.data);
							_this.meeting_list = res.data.data;
							_this.content = _this.meeting_list.event;
						} else {
							_this.$refs.uToast.show({
								title: res.data.message || '系统错误',
								type: 'warning',
							})
						}

					}
				})
			},
			delete_meeting() {
				let _this = this;
				this.display = false;
				let base_url = uni.getStorageSync('host');
				request({
					url: base_url + 'teacher/meeting_room/applyDelete',
					method: 'post',
					data: {
						apply_id: this.meeting_id ? this.meeting_id : 14,
					},
					success(res) {
						if (res.statusCode == 200) {
							console.log(res.data.data);
							_this.$toLink('../function_room/function_room', {

							})
						} else {
							_this.$refs.uToast.show({
								title: res.data.message || '系统错误',
								type: 'warning',
							})
						}

					}
				})
			},
			submit() {
				this.$toLink('../launch_application/launch_application', {
					id: this.meeting_id
				})
			}
		}
	}
</script>

<style lang="scss">
	.container {
		width: 100%;
		overflow: hidden;
		background: #F2F2F2;
		height: 100vh;

		.warp {
			display: flex;
			align-items: flex-start;
			justify-content: center;
			height: 100%;

			.rect {
				margin-top: 450rpx;
				border-radius: 10rpx;
				width: 480rpx;
				height: 250rpx;
				background-color: #fff;

				.tanchu {
					width: 100%;
					height: 150rpx;
					font-size: 33rpx;
					color: #3E3E3E;
					text-align: center;
					line-height: 150rpx;
				}

				.anniu {
					width: 100%;
					height: 100rpx;
					display: flex;
					justify-content: space-around;
					align-items: center;

					view {
						border-radius: 30rpx;
						width: 150rpx;
						height: 60rpx;
						text-align: center;
						line-height: 60rpx;
						font-size: 26rpx;

						&:nth-child(1) {
							color: #2C78FE;
							margin-left: 15rpx;
							border: 1px solid #2C78FE;
							background: #fff;

						}

						&:nth-child(2) {
							color: #fff;
							margin-right: 15rpx;
							background: linear-gradient(to right, #2C78FE, #32B0FF);
						}


					}
				}
			}
		}

		.list {
			width: 100%;
			margin-top: 20rpx;
			background: #fff;

			.name {
				width: 710rpx;
				margin-left: 20rpx;
				height: 62rpx;
				display: flex;
				justify-content: flex-start;

				text {
					font-size: 30rpx;
					color: #333333;
					margin-top: 25rpx;

					&:nth-child(1) {
						width: 100rpx;
					}

					&:nth-child(2) {}
				}
			}

			.num {
				width: 710rpx;
				margin-left: 20rpx;
				border-bottom: 1px solid #F2F2F2;
				height: 91rpx;
				display: flex;
				justify-content: flex-start;

				text {
					font-size: 30rpx;
					color: #333333;
					margin-top: 25rpx;

					&:nth-child(1) {
						margin-left: 30rpx;
						width: 75rpx;
					}

					&:nth-child(2) {}
				}
			}

			.address {
				width: 710rpx;
				margin-left: 20rpx;
				height: 60rpx;
				display: flex;
				justify-content: flex-start;

				text {
					font-size: 26rpx;
					margin-top: 30rpx;

					&:nth-child(1) {
						color: #666666;
						width: 150rpx;
					}

					&:nth-child(2) {
						color: #333333;
					}
				}
			}

			.type {
				width: 710rpx;
				margin-left: 20rpx;
				height: 60rpx;
				display: flex;
				justify-content: flex-start;

				text {
					font-size: 26rpx;
					margin-top: 30rpx;

					&:nth-child(1) {
						color: #666666;
						width: 150rpx;
					}

					&:nth-child(2) {
						color: #333333;
					}
				}
			}

			.galleryful {
				width: 710rpx;
				margin-left: 20rpx;
				height: 60rpx;
				display: flex;
				justify-content: flex-start;

				text {
					font-size: 26rpx;
					margin-top: 30rpx;

					&:nth-child(1) {
						color: #666666;
						width: 150rpx;
					}

					&:nth-child(2) {
						color: #333333;
					}
				}
			}

			.remarks {
				width: 710rpx;
				margin-left: 20rpx;
				height: 100rpx;
				display: flex;
				justify-content: flex-start;

				text {
					font-size: 26rpx;
					margin-top: 30rpx;

					&:nth-child(1) {
						color: #666666;
						width: 152rpx;
					}

					&:nth-child(2) {
						color: #333333;
					}
				}
			}

			.time {
				width: 710rpx;
				margin-left: 20rpx;
				height: 97rpx;
				display: flex;
				justify-content: flex-start;
				border-bottom: 1px solid #F2F2F2;

				text {
					margin-top: 32rpx;
					font-size: 26rpx;

					&:nth-child(1) {
						color: #666666;
						width: 150rpx;
					}

					&:nth-child(2) {
						color: #333333;
						width: 350rpx;
					}
					&:nth-child(3) {
						color: #333333;
						width: 16rpx;
					}
					&:nth-child(4) {
						color: #333333;
						width: 350rpx;
					}

					// &:nth-child(3) {
					// 	color: #333333;
					// 	width: 110rpx;
					// }

					// &:nth-child(4) {
					// 	color: #333333;
					// 	width: 16rpx;
					// }

					// &:nth-child(5) {
					// 	color: #333333;
					// 	width: 150rpx;
					// }

					// &:nth-child(6) {
					// 	color: #333333;
					// }
				}
			}

			.event {
				width: 710rpx;
				margin-left: 20rpx;
				height: 65rpx;
				display: flex;
				justify-content: flex-start;

				text {

					&:nth-child(1) {
						margin-top: 30rpx;
						width: 150rpx;
						font-size: 26rpx;
						color: #777777;
					}
				}

				input {
					&:nth-child(2) {
						outline: none;
						border: none;
						font-size: 26rpx;
						color: #999999;
						margin-top: 30rpx;
						width: 400rpx;

					}
				}
			}

		}

		.confirm {
			width: 100%;
			height: 500rpx;
			display: flex;
			justify-content: space-around;
			align-items: center;

			.verify {
				width: 200rpx;
				height: 60rpx;
				border-radius: 50rpx;
				text-align: center;
				line-height: 60rpx;
				background: linear-gradient(to right, #2C78FE, #32B0FF);
				color: #fff;
				font-size: 30rpx;
			}

			.cancel {
				width: 200rpx;
				height: 60rpx;
				border-radius: 50rpx;
				text-align: center;
				line-height: 60rpx;
				background: #fff;
				color: #666666;
				font-size: 30rpx;
			}
		}
	}
</style>
